#ifndef SWUPDATE_H
#define SWUPDATE_H

#include <QObject>
#include <QVariant>

class QTimer;

class SWUpdate : public QObject
{
    Q_OBJECT

public:
    explicit SWUpdate(QObject *parent = nullptr);
     ~SWUpdate();

    Q_INVOKABLE int getProgressMsgInt(QString key);
    Q_INVOKABLE QString getProgressMsgStr(QString key);
    Q_INVOKABLE QString getProgressMsgALL(void);

Q_SIGNALS:
    void start();
    void stop();
    void msgChanged();

protected Q_SLOTS:
    void onActivated(void);
    void onConnected(void);

private:
    QTimer *m_timer;
    int m_ipcFd;
    unsigned int m_curstep;
    unsigned int m_percent;
    QVariantMap m_msg;

    bool wait_update;
};

#endif // SWUPDATE_H
